package com.aaa.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 *  spring mvc 配置类
 */
@Configuration
public class MyMVCConfig implements WebMvcConfigurer {
    //跨域配置
    @Override
    public void addCorsMappings(CorsRegistry registry) {
       //registry.对于哪些路径.允许哪些项目的访问.允许接受跨域的cookie
        registry.addMapping("/**").allowedOrigins("*").allowCredentials(true);

    }
}
